#include "stdafx.h"

#include <string.h>
#include <iostream>

#include <Windows.h>

#include "Utils.h"
#include "gtest\gtest.h"

HANDLE createProcess(const wchar_t * str)
{
    wchar_t temp[65535];
    wcscpy_s(temp, str);

    STARTUPINFOW si = {};
    PROCESS_INFORMATION pi = {};
    si.cb = sizeof(STARTUPINFO);

    EXPECT_NE(FALSE, ::CreateProcessW(nullptr,
        temp,
        nullptr,
        nullptr,
        false,
        CREATE_NEW_CONSOLE,
        nullptr,
        nullptr,
        &si,
        &pi)) << "Create process : 'Injector.exe -n test.exe' failed!" << std::endl;

    return pi.hProcess;
}
